Skip to content

feat(BA-6891): add kernel scheduling-history v2 DTOs and service actions#12869

Merged
HyeockJinKim merged 2 commits into
mainfrom
feat/BA-6891-kernel-history-dto-service
Jul 21, 2026
Merged

feat(BA-6891): add kernel scheduling-history v2 DTOs and service actions#12869
HyeockJinKim merged 2 commits into
mainfrom
feat/BA-6891-kernel-history-dto-service

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 15, 2026

Copy link
Copy Markdown
Member

📚 Stacked PRs

Merge in order, bottom-up. Each PR is based on the one above it, so its diff shows only its own layer.

What

The v2 DTOs and the service layer for kernel scheduling history.

Review notes

The admin search is a global action. It is system-wide and unscoped, so its authorization is a SUPERADMIN role gate rather than RBAC scope resolution — which is what BaseGlobalAction / GlobalActionProcessor model. The processor applies the gate on the action path, behind the route's superadmin_required middleware. The scoped counterpart resolves against an RBAC scope and stays on the plain action path.

This makes search_kernel_history the only one of the four admin history searches on the global path; session/deployment/route predate GlobalActionProcessor and are untouched here. Converting them is a separate change — 44 REST v2 domains use superadmin_required and only retention_policy has adopted the new processor so far.

The DTOs are shared with GraphQL. Per common/dto/manager/v2/AGENTS.md these are the single source of truth for REST v2 and the Strawberry schema, so BA-6883 builds its GraphQL types on these rather than defining its own. That is why the scope's non-emptiness rule lives in KernelHistoryScopeDTO.model_validator — one rule, both surfaces, rather than restated per surface.

KernelHistoryNode has no sub_steps, deliberately. kernel_scheduling_history defines no such column — the 84b901f69d16 migration added sub_steps to the deployment and route tables only. Worth flagging: BEP-1061 (§2.3) and BA-6852 both describe kernel history as carrying sub_steps, which does not match the schema. That discrepancy belongs to the writer side (BA-6852) and is left alone here.

Only the two inputs that get wired are added. There is no offset-only SearchKernelHistoryInput mirroring SearchSessionHistoryInput — that one has no callers, and mirroring it would add dead code.

The service methods are thin passthroughs, consistent with the existing ones. SearchKernelScopedHistoryAction is a plain @dataclass, not frozen=True: the shared SchedulingHistoryAction base is non-frozen, so a frozen subclass is a TypeError. (services/AGENTS.md asks for frozen; the base and all six existing siblings already diverge. Out of scope here.)

The adapter that converts these DTOs and drives the processors is #12870.

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://sorna--12869.org.readthedocs.build/en/12869/


📚 Documentation preview 📚: https://sorna-ko--12869.org.readthedocs.build/ko/12869/

@github-actions github-actions Bot added size:L 100~500 LoC comp:manager Related to Manager component comp:common Related to Common component labels Jul 15, 2026
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from 497c88e to f9eff31 Compare July 15, 2026 09:40
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from db1b59b to 6d7ebbc Compare July 15, 2026 09:40
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from f9eff31 to 3cda92e Compare July 15, 2026 09:56
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from 6d7ebbc to e8ce7ad Compare July 15, 2026 09:56
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from 3cda92e to d384322 Compare July 15, 2026 10:17
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from e8ce7ad to b8a7aaa Compare July 15, 2026 10:17
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from d384322 to 05a2d77 Compare July 20, 2026 03:19
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from b8a7aaa to 01a65ec Compare July 20, 2026 04:10
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from 05a2d77 to d7b27fc Compare July 20, 2026 04:22
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from 01a65ec to e23c1a9 Compare July 20, 2026 04:22
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch from d7b27fc to 7b9fa27 Compare July 20, 2026 04:41
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from e23c1a9 to 320012c Compare July 20, 2026 04:41
@jopemachine
jopemachine force-pushed the feat/BA-6890-kernel-history-repository-scope branch 2 times, most recently from 8332a48 to c04a047 Compare July 20, 2026 04:47
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from 320012c to 564c862 Compare July 20, 2026 04:47
Base automatically changed from feat/BA-6890-kernel-history-repository-scope to main July 20, 2026 04:52
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch 2 times, most recently from c3289f0 to 8d1124c Compare July 20, 2026 05:05
@jopemachine
jopemachine marked this pull request as ready for review July 20, 2026 05:07
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch 2 times, most recently from 217d6c3 to ac0ef89 Compare July 20, 2026 06:16
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Jul 20, 2026
@jopemachine
jopemachine marked this pull request as ready for review July 20, 2026 06:23
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch 2 times, most recently from d347c7a to a4f9d28 Compare July 20, 2026 06:59
@github-actions github-actions Bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels Jul 20, 2026
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch 3 times, most recently from 1b11978 to ae6f600 Compare July 20, 2026 08:26
The admin search is system-wide and unscoped, so its authorization is the
SUPERADMIN role gate rather than RBAC scope resolution: it is a
BaseGlobalAction run through GlobalActionProcessor, which applies the gate
on the action path behind the route's superadmin_required middleware. The
scoped counterpart resolves against an RBAC scope and stays on the plain
action path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from ae6f600 to 0b3351f Compare July 20, 2026 08:41
@github-actions github-actions Bot added the area:docs Documentations label Jul 20, 2026
Co-authored-by: octodog <mu001@lablup.com>
@jopemachine
jopemachine force-pushed the feat/BA-6891-kernel-history-dto-service branch from 23b6dbd to 140c902 Compare July 20, 2026 08:50
@github-actions github-actions Bot added size:XL 500~ LoC require:db-migration Automatically set when alembic migrations are added or updated and removed size:L 100~500 LoC labels Jul 20, 2026
@HyeockJinKim
HyeockJinKim merged commit 88c69c1 into main Jul 21, 2026
36 checks passed
@HyeockJinKim
HyeockJinKim deleted the feat/BA-6891-kernel-history-dto-service branch July 21, 2026 01:23
fregataa pushed a commit that referenced this pull request Jul 21, 2026
PRs #12818 (b988f01b17a1) and #12869 (a1c4e7b93f22) each branched a
migration off 3f9a1c7b2e04 and merged independently, leaving two alembic
heads and failing scripts/check-multiple-alembic-heads.py.

Per the alembic README (keep a single linear head; never merge), reparent
the later-merged a1c4e7b93f22 (kernel history perms) onto the earlier
b988f01b17a1 (fair-share uniqueness). The two migrations are independent,
so ordering is safe. Chain is now:
  3f9a1c7b2e04 -> b988f01b17a1 -> a1c4e7b93f22

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants